package cn.csxw.openchina.ui.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.ArrayList;

import butterknife.BindView;
import cn.csxw.openchina.R;
import cn.csxw.openchina.base.BaseRecAdapter;
import cn.csxw.openchina.entity.bean.EventBean;
import cn.csxw.openchina.entity.bean.PostBean;
import cn.csxw.openchina.utils.Global;

/**
 * Created by User on 2017/1/16.
 */

public class ExerciseDetailAdapter extends BaseRecAdapter<PostBean> {
    public ExerciseDetailAdapter(ArrayList data) {
        super(data);
    }
    @Override
    protected void onItemClick(View v, int position) {

    }
    @Override
    protected BaseViewHolder getViewHolder(View itemView) {
        return new ExerciseDetailHolder(itemView);
    }

    @Override
    protected View getItemView(ViewGroup parent) {
        View itemView = Global.inflate(R.layout.view_exercise_recently_detail, parent);
        return itemView;
    }

    class ExerciseDetailHolder extends BaseViewHolder {
        @BindView(R.id.tv_recently_detail_title)
        TextView mTvRecentlyDetailTitle;
        @BindView(R.id.tv_recently_detail_start_time)
        TextView mTvRecentlyDetailStartTime;
        @BindView(R.id.tv_recently_detail_end_time)
        TextView mTvRecentlyDetailEndTime;
        @BindView(R.id.tv_recently_detail_address)
        TextView mTvRecentlyDetailAddress;
        @BindView(R.id.tv_recently_detail_)
        TextView mTvRecentlyDetail;
        @BindView(R.id.tv_recently_detail_second_title1)
        TextView mTvRecentlyDetailSecondTitle1;
        public ExerciseDetailHolder(View itemView) {
            super(itemView);
        }
        @Override//设置实体Bean数据
        public void setData(PostBean eventBean, int Position) {
            mTvRecentlyDetailTitle.setText(eventBean.title);
            mTvRecentlyDetailSecondTitle1.setText(eventBean.title);
            mTvRecentlyDetailStartTime.setText(eventBean.event.startTime);
            mTvRecentlyDetailEndTime.setText(eventBean.event.endTime);
            mTvRecentlyDetailAddress.setText(eventBean.event.spot);
            mTvRecentlyDetail.setText(eventBean.body);
        }
    }


}
